﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FDEE.Model
{

    public class CRebarRecord:RebarBase
    {
        //public int Radius, r, h, n, Lx, A, B, C, D ;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="mBarMark">钢筋主编号，例如1</param>
        /// <param name="sBarMark">钢筋次编号，例如1.1，默认为0</param>
        /// <param name="cBarMark">钢筋字符编号，例如1a，默认为空</param>
        /// <param name="diameter">钢筋直径，按eDB选取</param>
        /// <param name="radius">钢筋弯钩半径</param>
        /// <param name="r"></param>
        /// <param name="h"></param>
        /// <param name="n"></param>
        /// <param name="lx">弯钩长度值</param>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <param name="c"></param>
        /// <param name="d"></param>
        /// <param name="quantity"></param>
        /// <param name="shapeConfg"></param>
        public CRebarRecord(int mBarMark, int sBarMark, string cBarMark, eDB diameter,
            int radius, int r, int h, int n, int lx, int a, int b, int c, int d,
            int quantity, eShapeType shapeConfig):base(mBarMark,sBarMark,cBarMark,diameter,quantity,shapeConfig)
        {
            Radius = radius;
            this.r = r;
            this.h = h;
            this.n = n;
            Lx = lx;
            A = a;
            B = b;
            C = c;
            D = d;

            Formula = GlobalFuncs.GetFormulaLength(shapeConfig, A, B, C, D, Lx).Item1;
            

        }

        public override void SetLength()
        {
            Length = (Math.Round(GlobalFuncs.GetFormulaLength(ShapeConfg, A, B, C, D, Lx).Item2 * 0.001, 3, MidpointRounding.AwayFromZero)) ;
        }
    }
}
